package com.haierp.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.haierp.mapper.TaskNoStockReportMapper;
import com.haierp.mapper.bi.BiShipMapper;
import com.haierp.model.TaskNoStockReport;
import com.haierp.model.bi.BiShip;
import com.haierp.service.ITaskNoStockReportService;



@Service("taskNoStockReportService")
public class TaskNoStockReportServiceImpl extends SuperServiceImpl<TaskNoStockReportMapper, TaskNoStockReport> implements ITaskNoStockReportService {
	@Autowired
	private BiShipMapper biShipMapper;
	@Override
	public void insertTaskNoStockReport() {
		BiShip biship = biShipMapper.selectBiShiPNoStockReportByGmtCreate();
		if(biship != null){ //如花
			TaskNoStockReport taskNoStockReport = new TaskNoStockReport();
			taskNoStockReport.setShowDate(new Date());
			taskNoStockReport.setCompanyId(1L);
			taskNoStockReport.setStatisticSkuNumNoStockUp(biship.getStatisticSkuNumNoStockUp().intValue());
			taskNoStockReport.setStatisticSkuQuantityNoStockUp(biship.getStatisticSkuQuantityNoStockUp().intValue());
			this.insertSelective(taskNoStockReport);
		}
		BiShip bishipTwo = biShipMapper.selectBiShiPNoStockReportByGmtCreateYb();
		if(bishipTwo != null && bishipTwo.getStatisticSkuQuantityNoStockUp()!= null){ //艺博
			TaskNoStockReport taskNoStockReport = new TaskNoStockReport();
			taskNoStockReport.setShowDate(new Date());
			taskNoStockReport.setCompanyId(2L);
			taskNoStockReport.setStatisticSkuNumNoStockUp(bishipTwo.getStatisticSkuNumNoStockUp().intValue());
			taskNoStockReport.setStatisticSkuQuantityNoStockUp(bishipTwo.getStatisticSkuQuantityNoStockUp().intValue());
			this.insertSelective(taskNoStockReport);
		}
		
	}

	
}
